package com.medica.ledproject.entity;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author xiaona
 * @date 2024/5/29
 * @description TODO
 */
@Data
public class RequestPro {
    @Schema(name = "adress", description = "led 的id集合", required = true,example = "1,2,3")
    String adress;
    @Schema(name = "all", description = "是否是所有机器", required = true)
    boolean all;
    @Schema(name = "adminId", description = "用户id", required = true)
    int adminId;

    public String[] getAdress1() {
        if (StringUtils.isEmpty(adress)){
            return null;
        }
        if(adress.indexOf("[")>0) {
            adress = adress.substring(1, adress.length());
        }
        return adress.split(",");
    }
}
